﻿using System;
using System.Web.Mvc;
using Microsoft.Practices.Unity;
using WebShop.DAL;
using WebShop.DAL.Interfaces;

namespace WebShop.Controllers
{
    public class ErrorController : Controller
    {
        [Dependency]
        public ILogRepository LogRepository { get; set; }

        public ActionResult Error404(String aspxerrorpath)
        {
            LogRepository.Add("404 at " + aspxerrorpath, HttpContext.User.Identity.Name, true);

            return View();
        }

        public ActionResult Error500(String aspxerrorpath)
        {
            LogRepository.Add("500 at " + aspxerrorpath, HttpContext.User.Identity.Name, true);

            return View();
        }
    }
}
